﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;

/// <summary>
/// Descripción breve de Chat
/// </summary>
public class Chat
{
    ArrayList l;
	public Chat()
	{
        l = new ArrayList();
	}
    public String añadirLinea(Usuario u, String texto)
    {
        if (l.Count > 8)
        {
            l.RemoveAt(0);
        }
        String linea="<b>"+u.getAlias()+"</b>: "+texto;
        l.Add(linea);
        return getLineas();
    }
    public String getLineas()
    {
        String resul="";
        foreach (String linea in l)
        {
            resul += linea + "<br>";
        }
        return resul;
    }
}
